<extend name="Layout:layout_list" />
<block name="body_before_block">
    <script src="__THEME__Plugin/jquery-gridtimer-1.0/jquery-gridtimer-1.0.js" type="text/javascript"></script>
</block>
<block name="body_content_block">
    <table id="main_grid" class="easyui-datagrid" data-url="{:AddonU('Status/get_extension_talk_status_list_json')}"></table>
    <div id="tb" style="padding:2px 5px;">
        <table style="width:100%;"><tr><td><div id="sum" style="padding-top:3px; margin-right:5px;"></div></td><td style="width:100px;"><input type="text" id="grid-timer" value="0" /></td></tr></table>
    </div>
</block>
<block name="body_after_block">
    <script type="text/javascript">
        // 页面初始化
        $(document).ready(function () {
            $('#grid-timer').gridTimer({elapsed: function () {
                    $('#main_grid').datagrid('reload');
                }});
        })
        var curd_grid = CurdGrid.newInstance();
        curd_grid.config({
            title: '分机通话状态',
            toolbar: '#tb',
            onLoadSuccess: function (data) {
                $('#sum').html(data.sum);
            },
            pagination: false,
            columns: [[
                    {title: "分机", field: "分机", sortable: true, width: 120},
                    {title: "通话号码", field: "通话号码", sortable: true, width: 120},
                    {title: "状态", field: "状态", sortable: true, width: 120},
                    {title: "持续时间", field: "持续时间", sortable: true, width: 120},
                    {title: "租户", field: "租户", sortable: true, width: 120},
                ]],
        });
        curd_grid.init();
    </script>
</block>